import math

def cube(data:dict):
    """
    计算立方体，输入一个字典，返回一个字典
    :param data:字典，长l，宽d,高h，体积
    :return res:字典
    """
    if "l" in data and "d" in data and "h" in data:
        l = data["l"]
        d = data["d"]
        h = data["h"]
        Surface_area=2*(l*d+l*h+d*h)
        volume = l * d * h
    else:
        return {
            "error":"不能为空！"
        }
    return {
        "volume" : volume,
        "Surface_area" : Surface_area
    }


def test():
    """
    测试函数
    :return:
    """
    print(cube({"l": 2,"d": 2,"h": 2}))


test()